<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>盒子模型练习</title>
    <style>
        .card {
            width: 300px;
            background-color: #ff0;
            /*设置四个方向的内间距padding 边框与内容之间的距离*/
            padding: 10px;
            border: 2px solid red;
            /*设置下外间距，元素与元素之间的距离 在元素外面*/
            margin-bottom: 30px;
        }
        .card>img {
            width: 100%;
        }
        .card>p {
            border: 5px solid red;
            /*顺时针赋值:上右下左*/
            margin:10px 20px 30px 40px;
        }
    </style>
</head>
<body>
    <div class="card">
        <img src="https://cdn.tmooc.cn/bsfile//courseImg///5f791c0985cc4a67a5c4dca6627155b0.jpg" alt="">
        <p>我是文字</p>
    </div>
    <div class="card">
        <img src="https://cdn.tmooc.cn/bsfile//courseImg///5f791c0985cc4a67a5c4dca6627155b0.jpg" alt="">
        <p>我是文字</p>
    </div>
</body>
</html>